﻿using System;

    using KinonekoSoftware.Foundation.UI.Media;

namespace KinonekoSoftware.Studio.Components
{
#if WINDOWS
    using System.Windows.Media;

    public partial class WatermarkEditorViewModel
    {

        private ImageBrush  _watermarkBrush;
        private string      _watermarkText;
        private int         _angle;
        private FontFamily  _fontFamily;

        public WatermarkEditorViewModel()
        {
            CreateWatermarkCommand = CreateCommand(DoCreateWatermark);
        }

        private void DoCreateWatermark()
        {
            if (string.IsNullOrEmpty(_watermarkText))
            {
                return;
            }

            PushToView();
        }

        public int Angle
        {
            get => _angle;
            set => SetValue(ref _angle, Math.Clamp(value, 0, 359));
        }


        public FontFamily FontFamily
        {
            get => _fontFamily;
            set => SetValue(ref _fontFamily, value);
        }

        public string WatermarkText
        {
            get => _watermarkText;
            set => SetValue(ref _watermarkText, value);
        }

        public ImageBrush WatermarkBrush
        {
            get => _watermarkBrush;
            set => SetValue(ref _watermarkBrush, value);
        }
        
        public ICommandEX CreateWatermarkCommand { get; }
    }
#endif
}